package Chapter5;

class MaxPriority implements Runnable{
	public void run() {
		for(int i=0;i<10;i++) {
			System.out.println(Thread.currentThread().getName()+"is outing: "+i);
		}
	}
}
class MinPriority implements Runnable{
	public void run() {
		for(int i=0;i<10;i++) {
			System.out.println(Thread.currentThread().getName()+"is outing: "+i);
		}
	}
}
public class Example07 {
	public static void main(String[] args) {
		Thread minPriority=new Thread(new MinPriority(),"优先级较低的thread");
		Thread maxPriority=new Thread(new MaxPriority(),"优先级较高的thread");
		minPriority.setPriority(Thread.MIN_PRIORITY);
		maxPriority.setPriority(Thread.MAX_PRIORITY);
		maxPriority.start();
		minPriority.start();
	}
	

}
